#include <iostream>
#include <windows.h>
using namespace std;



int main()
{
	int max;
	int semax;
	int a[20] = {1,2,4,15,23,1,23,3,4,34,45,23,12,11,13,14,17,18,12,9};
	max = a[0];
	semax = a[0];
	for (int i=0; i < 19; i++)
	{
		if (a[i] > max)
		{
			semax = max;
			max = a[i];
		}
	}

	cout << max << " " << semax;

}